package com.nan.queue;

import java.util.Stack;

public class CQueue {
    public Stack<Integer> out;
    public Stack<Integer> in;
    public CQueue() {
        this.in = new Stack<>();
        this.out = new Stack<>();
    }

    public void appendTail(int value) {
        in.push(value);
    }

    public int deleteHead() {
        if(out.isEmpty()&& in.isEmpty()){
            return -1;
        }
        if(out.isEmpty()){
            while(!in.isEmpty()){
                out.push(in.pop());
            }
        }
        return out.pop();
    }
}
